package exp6;

class Line{
	Point p;
	Direction d;
	Line(Point p,Direction d){
		this.p=p;
		this.d=d;
	}

	static class Point{
		int x,y;
		Point(int x,int y){
			this.x=x;
			this.y=y;
		}
	}
	static enum Direction{
		left,right,up,down
	}
	void print() {
		System.out.println("这条线过"+'('+this.p.x+','+this.p.y+')'+" 方向为:"+this.d);
	}
}
public class LineTest {
	public static void main(String[] args) {
		Line.Point point1=new Line.Point(0,0);
		Line.Point point2=new Line.Point(1,2);
		Line.Direction direction1 =Line.Direction.down;
		Line.Direction direction2 =Line.Direction.left;
		Line line1 = new Line(point1,direction1);
		Line line2 = new Line(point2,direction2);
		line1.print();
		line2.print();


	}
}
